package com.apes.scm.masterdata.party.repository;

import com.alibaba.fastjson.JSONArray;
import com.apes.framework.query.ApesDao;
import org.springframework.stereotype.Component;

@Component
public class SupplierLogisticDao extends ApesDao {

    /***
     * 供应商发货点
     * @return
     */
    public JSONArray getSupplierShipItem() {
        String sSQL = "SELECT T.SUPPLIER_ID, T.SUPPLIER_NAME, T.PROVINCE_ID, T.PROVINCE_NAME,\n" +
                "       T.CITY_ID, T.CITY_NAME, T.COUNTY_ID, T.COUNTY_NAME, T.ADDRESS,\n" +
                "       T.CONTACT, T.PHONE, T.LATITUDE, T.LONGITUDE\n" +
                "  FROM MAS_SUPPLIER_SHIP_ITEM_TEMP T";
        return toJSONArray(find(sSQL));
    }

    /***
     * 供应商送达仓库（导入临时表数据）
     * @return
     */
    public JSONArray getSupplierReachItem() {
        String sSQL = "SELECT T.PHY_DEPOT_ID, T.SUPPLIER_ID, T.SUPPLIER_NAME, T.PHY_DEPOT_NAME\n" +
                "  FROM MAS_SUPPLIER_REACH_ITEM_TEMP T\n" +
                " WHERE 1 = 1";
        return toJSONArray(find(sSQL));
    }

}
